<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<div>
				<book-list :books="bookList">
					<template slot="book" slot-scope="props">
						<li>{{props.bookname}}</li>
					</template>
				</book-list>
			</div>
		</div>

		<template id="bookComp">
			<div>
				<ul>
					<slot name="book" v-for="book in books" :bookname="book.name"></slot>
				</ul>
			</div>
		</template>

		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#app",
				data: {
					bookList: [
						{
							name: "《Vue.js 实践》"
						},
						{
							name: "《ASP.NET 实战》"
						},
						{
							name: "《深入浅出Webbapack》"
						}
					]
				},
				components: {
					"book-list": {
						props: ["books"],
						template: "#bookComp"
					}
				}
			});
		</script>
	</body>
</html>
